<?php
/* @var $this AdvertisingAdminController */
/* @var $model DndBoxanhfoodAdvertising */
/* @var $form CActiveForm */
?>
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/jquery.datetimepicker.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/globalization/globalize.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/jqwidgets/jquery.datetimepicker.js"></script>
    <script>
        $(document).ready(function () {               
            $("#start_datetime").datetimepicker({format:'Y-m-d H:i:s'});
            $("#expired_datetime").datetimepicker({format:'Y-m-d H:i:s'});
        });
        
    </script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'dnd-advertising-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	// 'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data','name'=>'frmmain',),
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

    <div class="row">
		<?php echo $form->labelEx($model,'content_vn'); ?>
		<?php
			$this->widget('ext.cleditor.ECLEditor', array(
			'model'=>$model,
			'attribute'=>'content_vn', //Model attribute name. Nome do atributo do modelo.
			'options'=>array(
			'width'=>'600',
			'height'=>300,
			),
			'value'=>$model->content_vn,
		));
		?>
		<?php echo $form->error($model,'content_vn'); ?>
	</div>
	
	 <div class="row">
		<?php echo $form->labelEx($model,'content_en'); ?>
		<?php
			$this->widget('ext.cleditor.ECLEditor', array(
			'model'=>$model,
			'attribute'=>'content_en', //Model attribute name. Nome do atributo do modelo.
			'options'=>array(
			'width'=>'600',
			'height'=>300,
			),
			'value'=>$model->content_en,
			));
		?>
	<?php echo $form->error($model,'content_en'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
        <?php echo CHtml::dropDownList('Advertising[status]', 'status',array('1'=>'Đang hoạt động','0'=>'Ngưng hoạt động')); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<!--div class="row">
		<?php echo $form->labelEx($model,'format'); ?>
		<?php echo $form->textField($model,'format',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'format'); ?>
	</div-->

	<div class="row">
		<?php echo $form->labelEx($model,'type'); ?>
        <?php echo CHtml::dropDownList('Advertising[type]', 'type',array('0'=>'Tin tức','1'=>'Banner','2' => 'Về chúng tôi','3'=>'Liên hệ','4'=>'Dịch vụ')); ?>
		<?php echo $form->error($model,'type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'start_datetime'); ?>
		<?php echo $form->textField($model,'start_datetime',array('id'=>'start_datetime')); ?>
		<?php echo $form->error($model,'start_datetime'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'expired_datetime'); ?>
		<?php echo $form->textField($model,'expired_datetime',array('id'=>'expired_datetime')); ?>
		<?php echo $form->error($model,'expired_datetime'); ?>
	</div>
    <div class="row">
		<?php echo $form->labelEx($model,'image_'); ?>
		<?php echo $form->fileField($model, 'image_'); ?>
		<?php echo $form->error($model,'image_'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo' : 'Lưu'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->